home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / cl-support / cl-init.lisp < prev    next >
Encoding:
Text File  |  1994-09-27  |  4.8 KB  |  153 lines  |  [TEXT/CCL2]

  1. tq *load-verbose* t)
  2.   )
  3.  
  4.  
  5. ;;; AKCL complains if any package operations appear at top-level
  6. ;;; after any other code.
  7. ;;; Also prints useless notes about when it does tail recursion elimination.
  8. #+akcl
  9. (progn
  10.   (setq compiler:*suppress-compiler-notes* t)
  11.   (setq compiler:*compile-verbose* t)
  12.   (setq *load-verbose* t)
  13.   (setq compiler::*compile-ordinaries* t)
  14.   (si:putprop 'make-package nil 'compiler::package-operation)
  15.   (si:putprop 'shadow nil 'compiler::package-operation)
  16.   (si:putprop 'shadowing-import nil 'compiler::package-operation)
  17.   (si:putprop 'export nil 'compiler::package-operation)
  18.   (si:putprop 'unexport nil 'compiler::package-operation)
  19.   (si:putprop 'use-package nil 'compiler::package-operation)
  20.   (si:putprop 'unuse-package nil 'compiler::package-operation)
  21.   (si:putprop 'import nil 'compiler::package-operation)
  22.   (si:putprop 'provide nil 'compiler::package-operation)
  23.   (si:putprop 'require nil 'compiler::package-operation)
  24.   )
  25.  
  26.  
  27. ;;; Allegro also issues too many messages.
  28. ;;; ***We really ought to rename the defstructs that give the package
  29. ;;; locked errors....
  30.  
  31. #+allegro
  32. (progn
  33.   (setf *compile-print* nil)
  34.   (setf compiler:*cltl1-compile-file-toplevel-compatibility-p* nil)
  35.   (setq excl:*enable-package-locked-errors* nil)
  36.   (setf excl:*load-source-file-info* nil)
  37.   (setf excl:*record-source-file-info* nil)
  38.   (setf excl:*load-xref-info* nil)
  39.   (setf excl:*record-source-file-info* nil)
  40.   )
  41.  
  42.  
  43. ;;; Harlequin Lispworks prints too many messages too.
  44.  
  45. #+lispworks
  46. (progn
  47.   (setf *compile-print* nil)
  48.   (setf *load-print* nil)
  49.   (lw:toggle-source-debugging nil)
  50.   )
  51.  
  52.  
  53. ;;; Load up definitions
  54.  
  55. (defvar *lisp-source-file-type* ".lisp")
  56. (defvar *lisp-binary-file-type*
  57.   #+lucid
  58.   (namestring (make-pathname :type (car lcl:*load-binary-pathname-types*)))
  59.   #+allegro
  60.   (concatenate 'string "." excl:*fasl-default-type*)
  61.   #+cmu
  62.   (concatenate 'string "." (c:backend-fasl-file-type c:*backend*))
  63.   #+akcl
  64.   ".o"
  65.   #+mcl
  66.   ".fasl"
  67.   #+lispworks
  68.   ".wfasl"
  69.   #+wcl
  70.   ".o"
  71.   #+clisp
  72.   ".fas"
  73.   #-(or lucid allegro cmu akcl mcl lispworks wcl clisp)
  74.   (error "Don't know how to initialize *LISP-BINARY-FILE-TYPE*.")
  75.   )
  76.  
  77. (defvar *lisp-implementation-name*
  78.   #+lucid "lucid"
  79.   #+(and allegro next) "allegro-next"
  80.   #+(and allegro (not next)) "allegro"
  81.   #+cmu "cmu"
  82.   #+akcl "akcl"
  83.   #+mcl "mcl"
  84.   #+lispworks "lispworks"
  85.   #+wcl "wcl"
  86.   #+clisp "clisp"
  87.   #-(or lucid allegro cmu akcl mcl lispworks wcl clisp)
  88.   (error "Don't know how to initialize *LISP-IMPLEMENTATION-NAME*.")
  89.   )
  90.  
  91.  
  92.  
  93.  
  94. ;;; Note that this assumes that the current directory is $Y2.
  95. ;;; Environment variables in pathnames may not be supported by the
  96. ;;; host Lisp.
  97.  
  98. #-mcl (progn
  99.         (defvar *support-directory* "cl-support/")
  100.         (defvar *support-binary-directory*
  101.           (concatenate 'string 
  102.                        *support-directory* 
  103.                        *lisp-implementation-name*
  104.                        "/")))
  105.  
  106. (defun load-compiled-cl-file (filename)
  107.   (let ((source-file (concatenate 'string
  108.                   *support-directory*
  109.                   filename
  110.                   *lisp-source-file-type*))
  111.     (binary-file (concatenate 'string
  112.                   *support-binary-directory*
  113.                   filename
  114.                   *lisp-binary-file-type*)))
  115.     (if (or (not (probe-file binary-file))
  116.         (< (file-write-date binary-file) (file-write-date source-file)))
  117.     (compile-file source-file :output-file (merge-pathnames binary-file)))
  118.     (load binary-file)))
  119.  
  120.  
  121. ;;; Do NOT change the load order of these files.
  122.  
  123. (load-compiled-cl-file "cl-setup")
  124. (load-compiled-cl-file "cl-support")
  125. (load-compiled-cl-file "cl-definitions")
  126. (load-compiled-cl-file "cl-types")
  127. (load-compiled-cl-file "cl-structs")
  128. (load-compiled-cl-file "foreign")
  129.  
  130.  
  131. ;;; It would be nice if at this point we could switch *package*
  132. ;;; over to the right package.  But because *package* is rebound while 
  133. ;;; this file is being loaded, it will get set back to whatever it was 
  134. ;;; anyway.  Bummer.  Well, let's at least make the package that we want 
  135. ;;; to use.
  136.  
  137. (make-package "MUMBLE-USER" :use '("MUMBLE"))
  138.  
  139.  
  140. ;;; Compile and load the rest of the system.  (The Lucid compiler is fast
  141. ;;; enough to make it practical to compile things all the time.)
  142.  
  143. (eval-when (eval compile load)
  144.   (setf *package* (find-package "MUMBLE-USER")))
  145.  
  146. (load "$Y2/support/system")
  147. (compile-haskell)
  148.  
  149.  
  150. ;;; All done
  151.  
  152. (write-line "Remember to do (in-package \"MUMBLE-USER\")!")
  153.